﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using EasyBuildingCMS.BLL.CoreEngine;

namespace EasyBuildingCMS.UserControls.Core.BuildingBlock
{
    public partial class BuildingBlockEditor : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
                if (this.Controls.Count <= 0)
                {
                    int buildingBlockInstanceID = (int)(BLL.Helper.ToInt(HttpContext.Current.Request.QueryString["buildingBlockInstanceID"]));
                    BuildingBlockInstanceRepository buildingBlockInstaceRepository = new BuildingBlockInstanceRepository();
                    BuildingBlockInstance buildingBlockInstance = buildingBlockInstaceRepository.GetBuildingBlockInstanceID(buildingBlockInstanceID);
                    string fileName = buildingBlockInstance.BuildingBlock.BuildingBlockEditorFileName;
                    this.Controls.Add(this.LoadControl(buildingBlockInstance.BuildingBlock.BuildingBlockEditorFileName));
                }

          

        }
    }
}